package com.ruoyi.wifiauth.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * WiFi策略配置
 * 
 * @author ruoyi
 */
@Component
@ConfigurationProperties(prefix = "wifi.strategy")
public class WifiStrategyConfig {
    
    /**
     * 缓存TTL (秒)
     */
    private int cacheTtl = 300;
    
    /**
     * 是否启用缓存
     */
    private boolean cacheEnabled = true;
    
    /**
     * 默认策略配置
     */
    private DefaultStrategyConfig defaultStrategy = new DefaultStrategyConfig();
    
    public int getCacheTtl() {
        return cacheTtl;
    }
    
    public void setCacheTtl(int cacheTtl) {
        this.cacheTtl = cacheTtl;
    }
    
    public boolean isCacheEnabled() {
        return cacheEnabled;
    }
    
    public void setCacheEnabled(boolean cacheEnabled) {
        this.cacheEnabled = cacheEnabled;
    }
    
    public DefaultStrategyConfig getDefault() {
        return defaultStrategy;
    }
    
    public void setDefault(DefaultStrategyConfig defaultStrategy) {
        this.defaultStrategy = defaultStrategy;
    }
    
    /**
     * 默认策略配置
     */
    public static class DefaultStrategyConfig {
        private String strategyId = "0";
        private String strategyName = "默认策略";
        private int advertisementCount = 3;
        private int durationSeconds = 10;
        private List<DefaultMaterial> materials;
        
        public String getStrategyId() {
            return strategyId;
        }
        
        public void setStrategyId(String strategyId) {
            this.strategyId = strategyId;
        }
        
        public String getStrategyName() {
            return strategyName;
        }
        
        public void setStrategyName(String strategyName) {
            this.strategyName = strategyName;
        }
        
        public int getAdvertisementCount() {
            return advertisementCount;
        }
        
        public void setAdvertisementCount(int advertisementCount) {
            this.advertisementCount = advertisementCount;
        }
        
        public int getDurationSeconds() {
            return durationSeconds;
        }
        
        public void setDurationSeconds(int durationSeconds) {
            this.durationSeconds = durationSeconds;
        }
        
        public List<DefaultMaterial> getMaterials() {
            return materials;
        }
        
        public void setMaterials(List<DefaultMaterial> materials) {
            this.materials = materials;
        }
    }
    
    /**
     * 默认素材配置
     */
    public static class DefaultMaterial {
        private String materialId;
        private String materialName;
        private String materialType;
        private String materialUrl;
        private int durationSeconds;
        
        public String getMaterialId() {
            return materialId;
        }
        
        public void setMaterialId(String materialId) {
            this.materialId = materialId;
        }
        
        public String getMaterialName() {
            return materialName;
        }
        
        public void setMaterialName(String materialName) {
            this.materialName = materialName;
        }
        
        public String getMaterialType() {
            return materialType;
        }
        
        public void setMaterialType(String materialType) {
            this.materialType = materialType;
        }
        
        public String getMaterialUrl() {
            return materialUrl;
        }
        
        public void setMaterialUrl(String materialUrl) {
            this.materialUrl = materialUrl;
        }
        
        public int getDurationSeconds() {
            return durationSeconds;
        }
        
        public void setDurationSeconds(int durationSeconds) {
            this.durationSeconds = durationSeconds;
        }
    }
} 